﻿<%@ Page Title="Trang Quản Lý Sản Phẩm" Language="C#" MasterPageFile="~/admincp/Site.master" AutoEventWireup="true" CodeFile="Products.aspx.cs" Inherits="admincp_Products" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>
<%@ Register
    TagPrefix="customEditors"
    Namespace="AjaxControlToolkit.HTMLEditor.Samples" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register assembly="CKEditor.NET" namespace="CKEditor.NET" tagprefix="CKEditor" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <style>
        .layout {
            background:#3c5b9b;
        }
        .layout h2 { margin-left: 40px; padding-left: 0.1em; font-size: 2em; line-height: 1em; font-size:40px;
			font-family: Arial, Helvetica, sans-serif;
			color: #504f4f;
			text-shadow: 0px 2px 1px #333;
        }
        .manager {
            clear: both;
            width: 100%;
            margin-left: 20px;
            width:980px;
            padding-bottom:10px;
        }
        footer {
            clear:both;
            text-align:right;
            padding-top:30px;
            padding-bottom:20px;
            background:#0d0d0d;
        }
        .layout a{
            color:white;text-decoration:none; margin-left: 20px;
        }
        .layout a:hover{
           color:#c2baba;text-decoration:none; margin-left: 20px;
        }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2>Trang Quản Lý Sản Phẩm</h2>
    <br />
    &nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Label ID="lblThongBao" runat="server" /><br />
    <asp:HyperLink ID="hlBasicProduct" runat="server" Text="Quản lý sản phẩm" ></asp:HyperLink>
    <asp:HyperLink ID="hTemplateManager" runat="server" Text="Quản lý template chi tiết sản phẩm"></asp:HyperLink>
    <asp:MultiView ID="MutiView1" ActiveViewIndex="0" runat="server">
        <asp:View ID="View1" runat="server">
            <div class="manager">
            <asp:Panel ID="pnProduct" runat="server" GroupingText="Mục Nhập Thông Tin Cơ Bản Sản Phẩm Mới">
                <table>
                    <tr>
                        <td>Tên sản phẩm</td>
                        <td><asp:TextBox ID="txtProductName" Width="130" runat="server" /></td>
                        
                        <td>Chủng Loại</td>
                        <td>
                            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                                <ContentTemplate>
                                    <asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCategory_SelectedIndexChanged1" Width="130px">
                                    </asp:DropDownList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td>
                        <td>Nhà Cung Cấp</td>
                        <td>
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                    <asp:DropDownList ID="ddlSupplier" runat="server" Width="130px">
                                    </asp:DropDownList>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </td> 
                        <td>Xuất Xứ</td>
                        <td>
                            <asp:TextBox ID="txtOrigin" runat="server"/>
                        </td>
                    </tr>
                    <tr>
                        <td>Giá Bán</td>
                        <td><asp:TextBox ID="txtPrice" Width="130" runat="server" /></td>
                        <td>Số Lượng</td>
                        <td><asp:TextBox ID="txtAmount" Width="130" runat="server" /></td>
                        <td>VT sắp xếp</td>
                        <td><asp:TextBox ID="txtweigh" Width="130" runat="server" /></td>
                    </tr>
                    <tr valign="top">
                        <td colspan="2">
                            <asp:Image ID="imgPhotoPath" runat="server" Height="240px" Width="240px" />
                        </td>
                        <td colspan="6">

                            <table style="width:100%;">
                                <tr valign="top">
                                    <td>Mô tả sản phẩm</td>
                                    <td>
                                        <CKEditor:CKEditorControl ID="txtDescription" runat="server"></CKEditor:CKEditorControl>
                                    </td>
                                </tr>
                                <tr valign="top">
                                    <td>Hình sản phẩm</td>
                                    <td>
                                        <asp:FileUpload ID="ful_upload" runat="server" />
                                    </td>
                                </tr>
                                <tr valign="top">
                                    <td>Báo hết hàng</td>
                                    <td>
                                        <asp:RadioButtonList ID="rbtnDiscountinued" runat="server" RepeatDirection="Horizontal">
                                            <asp:ListItem Enabled="true" Selected="True" Text="Bán" Value="1"></asp:ListItem>
                                            <asp:ListItem Text="Ngừng bán" Value="0" />
                                        </asp:RadioButtonList></td>
                                </tr>
                            </table>

                        </td>
                    </tr>
                </table>
            </asp:Panel><br />
            <span class="button-met dark"><asp:Button ID="btnInsert" CssClass="button" Text="Thêm Mới" runat="server" OnClick="btnInsert_Click" BorderWidth="0px" /></span>&nbsp;
            <span class="button-met dark"><asp:Button ID="btnUpdate" CssClass="button" Text="Cập nhật" runat="server" OnClick="btnUpdate_Click" BorderWidth="0px" /></span>
            <br /><br />
            <asp:GridView ID="gvProduct" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" Width="947px" OnSelectedIndexChanging="gvProduct_SelectedIndexChanging" AllowPaging="true" OnPageIndexChanging="gvProduct_PageIndexChanging" PageSize="5" OnRowDeleting="gvProduct_RowDeleting">
                <Columns>
                    <asp:BoundField HeaderText="STT" DataField="id" />
                    <asp:BoundField HeaderText="Tên SP" DataField="name" />
                    <asp:BoundField DataField="categoryid" HeaderText="Mã loại" />
                    <asp:TemplateField HeaderText="Hình SP">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Eval("photopath") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Image ID="Image1" runat="server" Height="100px" ImageUrl='<%# Eval("photopath", "~/Image/Products/{0}") %>' Width="100px" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Ngày tạo">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("createdate") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("createdate","{0: dd/MM/yyyy}") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="Giá Bán" DataField="price" />
                    <asp:BoundField HeaderText="SL Tồn" DataField="amount" />
                    <asp:CommandField SelectText="Sửa" ShowSelectButton="true" />
                    <asp:CommandField DeleteText="Xóa" ShowDeleteButton="true" />
                </Columns>
                <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
                <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
                <RowStyle BackColor="White" ForeColor="#330099" VerticalAlign="Top" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
                <SortedAscendingCellStyle BackColor="#FEFCEB" />
                <SortedAscendingHeaderStyle BackColor="#AF0101" />
                <SortedDescendingCellStyle BackColor="#F6F0C0" />
                <SortedDescendingHeaderStyle BackColor="#7E0000" />
            </asp:GridView>
        </div>
        </asp:View>
    </asp:MultiView>
            
        
</asp:Content>

